]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
remoteSearch: Fix remote search providers
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 19 Sep 2017 21:58:29 +0000 (23:58 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 21 Sep 2017 14:53:32 +0000 (16:53 +0200)
Commit 289f982949c2 broke all remote providers when adding support for
non-auto-started search providers: Whether the provider should be
auto-started needs to be known in the constructor, so setting the
property on the constructed object doesn't work.

https://bugzilla.gnome.org/show_bug.cgi?id=787986

js/ui/remoteSearch.js

index a7be9265d717910c82e69721b75085216c89e781..de09ae9793eb77f1bc31e7cc8ee5c1130a1bc2f8 100644 (file)
@@ -98,6 +98,13 @@ function loadRemoteSearchProviders(searchSettings, callback) {
                 return;
             }
 
+            let autoStart = true;
+            try {
+                autoStart = keyfile.get_boolean(group, 'AutoStart');
+            } catch(e) {
+                // ignore error
+            }
+
             let version = '1';
             try {
                 version = keyfile.get_string(group, 'Version');
@@ -106,9 +113,9 @@ function loadRemoteSearchProviders(searchSettings, callback) {
             }
 
             if (version >= 2)
-                remoteProvider = new RemoteSearchProvider2(appInfo, busName, objectPath);
+                remoteProvider = new RemoteSearchProvider2(appInfo, busName, objectPath, autoStart);
             else
-                remoteProvider = new RemoteSearchProvider(appInfo, busName, objectPath);
+                remoteProvider = new RemoteSearchProvider(appInfo, busName, objectPath, autoStart);
 
             remoteProvider.defaultEnabled = true;
             try {
@@ -117,13 +124,6 @@ function loadRemoteSearchProviders(searchSettings, callback) {
                 // ignore error
             }
 
-            remoteProvider.autoStart = true;
-            try {
-                remoteProvider.autoStart = keyfile.get_boolean(group, 'AutoStart');
-            } catch(e) {
-                // ignore error
-            }
-
             objectPaths[objectPath] = remoteProvider;
             loadedProviders.push(remoteProvider);
         } catch(e) {
@@ -191,12 +191,12 @@ function loadRemoteSearchProviders(searchSettings, callback) {
 var RemoteSearchProvider = new Lang.Class({
     Name: 'RemoteSearchProvider',
 
-    _init: function(appInfo, dbusName, dbusPath, proxyInfo) {
+    _init: function(appInfo, dbusName, dbusPath, autoStart, proxyInfo) {
         if (!proxyInfo)
             proxyInfo = SearchProviderProxyInfo;
 
         let g_flags = Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES;
-        if (remoteProvider.autoStart)
+        if (autoStart)
             g_flags |= Gio.DBusProxyFlags.DO_NOT_AUTO_START_AT_CONSTRUCTION;
         else
             g_flags |= Gio.DBusProxyFlags.DO_NOT_AUTO_START;
@@ -319,8 +319,8 @@ var RemoteSearchProvider2 = new Lang.Class({
     Name: 'RemoteSearchProvider2',
     Extends: RemoteSearchProvider,
 
-    _init: function(appInfo, dbusName, dbusPath) {
-        this.parent(appInfo, dbusName, dbusPath, SearchProvider2ProxyInfo);
+    _init: function(appInfo, dbusName, dbusPath, autoStart) {
+        this.parent(appInfo, dbusName, dbusPath, autoStart, SearchProvider2ProxyInfo);
 
         this.canLaunchSearch = true;
     },